package com.foruo.learn.designmode.proxy.dynamicProxy;

import com.foruo.learn.designmode.proxy.IPerson;
import com.foruo.learn.designmode.proxy.Person;

/**
 * 测试类
 * @author GaoYuan
 * @date 2018/5/28 上午8:45
 */
public class TestMe {

    public static void main(String[] args){
        //普通调用
        IPerson person = new Person();
        System.out.println(person.getClass());
        person.eat();
        //动态代理调用
        IPerson personProxy = (IPerson) new PersonDynamicProxy(person).getProxyInstance();
        System.out.println(personProxy.getClass());
        personProxy.eat();
    }
}
